﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration.Provider;
using Mal.Web.Security.DataModel;
using System.Collections.Specialized;
using System.Windows.Forms;

namespace Mal.Web.Security.Provider
{
    /// <summary>
    /// Manages user permissions in application.
    /// </summary>
    /// <remarks>
    /// Permission management is based on ASP.NET role management.
    /// </remarks>
    public abstract class PermissionProvider : ProviderBase
    {
        private string applicationName;
        ///<summary>Gets or sets the name of the application 
        ///to store and retrieve permission information for. 
        ///</summary>
        public string ApplicationName 
        {
            get
            {
                if (string.IsNullOrEmpty(this.applicationName))
                    this.applicationName = Application.ExecutablePath;

                return this.applicationName;
            }
            set
            {
                this.applicationName = value;
            }
        }

        public abstract bool UserHasPermission(string userName, string permissionName);
        public abstract bool Authenticate(string userName, string password);
        public abstract Guid? GetUserId(string userName);

       
        
    }
}
